package ${filePackageName};

import ${beanCommonPackage}.EntityData;
import ${entityPackage}.${upperEntityName};
import ${commonControllerPackage}.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;

/**
 * ${tableComment}页面请求
 *
 * @author ${projectAuthor}
 * @version 1.0
 * @date ${nowDate}
 */
@ApiIgnore
@RequestMapping("/${lowerEntityName}")
@Controller
public class ${upperEntityName}ViewController extends BaseController {

	@GetMapping(value = "/list")
	public String ${lowerEntityName}List(Model model){
		EntityData entityData = getEntityData(${upperEntityName}.class,"${lowerEntityName}","${lowerPrimaryKey}");
		model.addAttribute("entityData",entityData);
		model.addAttribute("sortName","${sortName}");
		model.addAttribute("sortOrder","${sortOrder}");
		return "${lowerEntityName}/${lowerEntityName}List";
	}

	@GetMapping(value = "/add")
	public String ${lowerEntityName}Add(Model model){
		EntityData entityData = getEntityData(${upperEntityName}.class,"${lowerEntityName}","${lowerPrimaryKey}");
		model.addAttribute("entityData",entityData);
		return "${lowerEntityName}/${lowerEntityName}Add";
	}

	@GetMapping(value = "/edit")
	public String ${lowerEntityName}Edit(Model model){
		EntityData entityData = getEntityData(${upperEntityName}.class,"${lowerEntityName}","${lowerPrimaryKey}");
		model.addAttribute("entityData",entityData);
		return "${lowerEntityName}/${lowerEntityName}Edit";
	}
}
